package com.jingming.consult.base

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment

/**
 * fragment 基类
 */
abstract class BaseFragment : Fragment() {

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {

        return inflater.inflate(
            getLayoutid(), container,
            false
        )
    }

    override fun onActivityCreated(savedInstanceState: Bundle?) {
        super.onActivityCreated(savedInstanceState)
        onCreateView(savedInstanceState)
    }

    /**
     * 布局id
     */
    abstract fun getLayoutid(): Int

    // public void setType(int type) {
    // this.type = type;
    // }
    protected open fun onCreateView(savedInstanceState: Bundle?) {}
}